package com.lrr.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lrr.dao.WorkSheetDao;
import com.lrr.entity.QueryVo;
import com.lrr.entity.Worksheet;
import com.lrr.service.WorkSheetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkSheetServiceImpl implements WorkSheetService {

    @Autowired
    WorkSheetDao dao;

    @Override
    public PageInfo<Worksheet> list(QueryVo vo, Integer pageNum) {
        PageHelper.startPage(pageNum,3);
        List<Worksheet> list = dao.list(vo);
        return new PageInfo<Worksheet>(list);
    }

    @Override
    public Worksheet getByOdd(String odd) {
        return dao.getByOdd(odd);
    }

    @Override
    public void update(Worksheet worksheet) {
        dao.update(worksheet);
    }

    @Override
    public void del(String odd) {
        dao.del(odd);
    }
}
